package com.ruoyi.project.business.book.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.business.book.mapper.Book2Mapper;
import com.ruoyi.project.business.book.domain.Book2;
import com.ruoyi.project.business.book.service.IBook2Service;
import com.ruoyi.common.utils.text.Convert;

/**
 * 图书Service业务层处理
 * 
 * @author ZW
 * @date 2022-04-08
 */
@Service
public class Book2ServiceImpl implements IBook2Service
{
    @Autowired
    private Book2Mapper book2Mapper;

    /**
     * 查询图书
     * 
     * @param id 图书主键
     * @return 图书
     */
    @Override
    public Book2 selectBook2ById(Integer id)
    {
        return book2Mapper.selectBook2ById(id);
    }

    /**
     * 查询图书列表
     * 
     * @param book2 图书
     * @return 图书
     */
    @Override
    public List<Book2> selectBook2List(Book2 book2)
    {
        return book2Mapper.selectBook2List(book2);
    }

    @Override
    public List<Book2> selectBook2List2(Book2 book2) {
        return book2Mapper.selectBook2List2(book2);

    }

    /**
     * 新增图书
     * 
     * @param book2 图书
     * @return 结果
     */
    @Override
    public int insertBook2(Book2 book2)
    {
        return book2Mapper.insertBook2(book2);
    }

    /**
     * 修改图书
     * 
     * @param book2 图书
     * @return 结果
     */
    @Override
    public int updateBook2(Book2 book2)
    {
        return book2Mapper.updateBook2(book2);
    }

    /**
     * 批量删除图书
     * 
     * @param ids 需要删除的图书主键
     * @return 结果
     */
    @Override
    public int deleteBook2ByIds(String ids)
    {
        return book2Mapper.deleteBook2ByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除图书信息
     * 
     * @param id 图书主键
     * @return 结果
     */
    @Override
    public int deleteBook2ById(Integer id)
    {
        return book2Mapper.deleteBook2ById(id);
    }
}
